package com.example.personalfoodadmin.activities;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.TextView;

import com.example.personalfoodadmin.R;

public class Description extends Activity
{

    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        
        setContentView(R.layout.description);
        
        Intent i = this.getIntent();
        
        String description = i.getStringExtra(FoodDatabase.DESCRIPTION_INFO);
        
        if(description!=null)
        {
            TextView tv = (TextView)this.findViewById(R.id.desc_text_view);
            tv.setText(description);
        }
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu)
    {
        // Inflate the menu; this adds items to the action bar if it is present.
        
        getMenuInflater().inflate(R.menu.description, menu);
        
        return true;
    }
    
    public void backToFoodDatabase(final View view)
    {
        Intent i = new Intent(this, FoodDatabase.class);
        this.startActivity(i);    
            
    }

}
